<template>
  <div class="page">
    <div class="layui-fluid">
      <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
          <div class="layui-card">
            <div class="layui-card-body">
              <div class="layui-form" lay-filter>
                <div class="layui-form-item">
                  <label class="layui-form-label">门店名称</label>
                  <div class="layui-input-block" style="width: 190px;">
                    <input
                      type="text"
                      name="name"
                      placeholder="输入门店名称"
                      v-model="itemData.name"
                      autocomplete="off"
                      class="layui-input"
                      disabled="disabled"
                    />
                  </div>
                </div>
                <div class="layui-form-item">
                  <label class="layui-form-label">联系方式</label>
                  <div class="layui-input-block" style="width: 190px;">
                    <input
                      type="number"
                      name="userMobile"
                      placeholder="输入手机号码"
                      v-model="itemData.dealer.mobile"
                      autocomplete="off"
                      class="layui-input"
                      disabled="disabled"
                      maxlength="11"
                    />
                  </div>
                </div>
                <div class="layui-form-item">
                  <div class="layui-inline">
                    <label class="layui-form-label">商品图片</label>
                    <div class="layui-input-inline" style="width: 190px;">
                      <div class="layui-upload">
                        <button
                          type="button"
                          class="layui-btn"
                          id="layuiadmin-upload-useradmin"
                          disabled="disabled"
                        >选择文件</button>
                      </div>
                    </div>
                  </div>
                </div>
                <div class="layui-form-item">
                  <div class="layui-inline">
                    <label class="layui-form-label">图片预览</label>
                    <div class="layui-input-inline" style="width: 190px;">
                      <img
                        id="img"
                        :src="
                        itemData.rotationPictures
                          ? itemData.rotationPictures
                          : require('@/assets/zwyl.jpg')
                      "
                        style="width:100px;height:100px;"
                        disabled="disabled"
                      />
                    </div>
                  </div>
                </div>
                <div class="layui-form-item">
                  <label class="layui-form-label">店铺类型</label>
                  <div class="layui-input-inline">
                    <select
                      name="shopTypeId"
                      lay-filter="shopTypeId"
                      v-model="itemData.shopTypeId"
                      disabled="disabled"
                    >
                      <option value="1">个体店</option>
                      <option value="2">连锁店总店</option>
                      <option value="3">直营连锁店</option>
                      <option value="4">加盟连锁店</option>
                      <option value="5">虚拟店</option>
                    </select>
                  </div>
                </div>

                <div class="layui-form-item">
                  <label class="layui-form-label">详细地址</label>
                  <div class="layui-input-block" style="width: 190px;">
                    <input
                      type="text"
                      name="address"
                      placeholder="输入地址"
                      v-model="itemData.address"
                      autocomplete="off"
                      class="layui-input"
                      disabled="disabled"
                    />
                  </div>
                </div>

                <div class="layui-form-item">
                  <label class="layui-form-label">人均消费</label>
                  <div class="layui-input-block" style="width: 190px;">
                    <input
                      type="text"
                      name="perCapita"
                      placeholder
                      v-model="itemData.perCapita"
                      autocomplete="off"
                      class="layui-input"
                      disabled="disabled"
                    />
                  </div>
                </div>

                <div class="layui-form-item">
                  <label class="layui-form-label">全店销量</label>
                  <div class="layui-input-block" style="width: 190px;">
                    <input
                      type="text"
                      name="salesVolume"
                      placeholder
                      v-model="itemData.salesVolume"
                      autocomplete="off"
                      class="layui-input"
                      disabled="disabled"
                    />
                  </div>
                </div>

                <div class="layui-form-item">
                  <label class="layui-form-label">点评人数</label>
                  <div class="layui-input-block" style="width: 190px;">
                    <input
                      type="text"
                      name="scoreAmount "
                      placeholder
                      v-model="itemData.scoreAmount"
                      autocomplete="off"
                      class="layui-input"
                      disabled="disabled"
                    />
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  name: "shopdetail",
  data() {
    return {
      id: "",
      itemData: {
        name: "",
        rotationPictures: "",
        perCapita: "",
        scoreAmount: "",
        salesVolume: "",
        shopTypeId: "",
        address: "",
        dealer: {
          mobile: "",
        },
      },
    };
  },
  mounted() {
    var _this = this;
    window.getdates = this.getdates;
  },
  methods: {
    getdates: function (data) {
      var _this = this;
      var url = "/shop/aapi/v1.9/shops/" + data.id;
      ajaxRequest(url, "GET", "json", "", function (ret, err) {
        _this.itemData = ret.data; //门店信息
      });
    },
  },
  updated: function () {
    layui.use("form", function () {
      var form = layui.form;
      form.render();
    });
  },
};
</script>
<style>
#J_imageView img {
  width: 400px;
  display: block;
}
</style>
